package com.zq.server.api.domain.entity;


import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 订单表
 *
 * @TableName orders
 */

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ApiOrders implements Serializable {

    //TODO
    /**
     * 1 STAY_PAY 待付款
     * 2 OVER_PAY 已支付
     * 3 OVER_CANCEL 已取消
     */
    public static final Integer STAY_PAY = 1;
    public static final Integer OVER_PAY = 2;
    public static final Integer OVER_CANCEL = 3;
    public static final Integer DELIVERY_IN_PROGRESS = 4;
    /**
     * 支付状态 0未支付 1已支付 2退款
     */
    public static final Integer UN_PAID = 0;
    public static final Integer PAID = 1;
    public static final Integer REFUND = 2;
    public static final Integer WX_PAY = 0;
    /**
     * 主键
     */
    private Long id;
    /**
     * 订单号
     */
    private String number;
    /**
     * 订单状态 1待付款 2已付款  3已取消   4已签到  5已退款
     */
    private Integer status;
    /**
     * 下单用户
     */
    private Long userId;
    /**
     * 下单时间
     */
    private LocalDateTime orderTime;
    /**
     * 结账时间
     */
    private LocalDateTime checkoutTime;
    /**
     * 支付方式 1微信,2支付宝
     */
    private Integer payMethod;
    /**
     * 支付状态 0未支付 1已支付 2退款
     */
    private Integer payStatus;
    /**
     * 实收金额
     */
    private BigDecimal amount;
    /**
     * 备注
     */
    private String remark;
    /**
     * 手机号
     */
    private String phone;
    /**
     * 用户名称
     */
    private String userName;
    /**
     * 订单取消原因
     */
    private String cancelReason;
    /**
     * 订单拒绝原因
     */
    private String rejectionReason;
    /**
     * 订单取消时间
     */
    private LocalDateTime cancelTime;
    /**
     * 组id
     */
    private Long groupId;
    /**
     * 组信息 TODO
     */
    private ApiGroup group;

}
